-
Notifications
You must be signed in to change notification settings - Fork 704
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Minimize signature verification when bootstrapping #3255
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
yacovm
requested review from
abi87,
StephenButtolph,
danlaine and
dhrubabasu
as code owners
July 31, 2024 16:40
yacovm
force-pushed
the
fasterBootstrap
branch
3 times, most recently
from
July 31, 2024 19:11
5d95957
to
e3ad23c
Compare
marun
reviewed
Aug 1, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small suggestions
StephenButtolph
approved these changes
Aug 1, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 last naming nit then lgtm
dhrubabasu
approved these changes
Aug 1, 2024
github-merge-queue
bot
removed this pull request from the merge queue due to failed status checks
Aug 1, 2024
When bootstrapping blocks of the P-chain, the node verifies blocks when it replicates them from remote nodes, and afterwards it executes them. When executing them, it verifies the blocks once again via parsing them. This is redundant, as it has already parsed them before while replicating them. This change introduces an interface called Appraiser, which similar to the parser found in snow/engine/snowman/block/vm.go, converts the bytes of a block to a snowman.Block. However, unlike the Parser, it is only implemented at the proposerVM, and doesn't verify the signature of the block, reducing the CPU cycles it costs to execute the blocks when bootstrapping. When testing a chunk of 1000 blocks, parsing the blocks without verifying the signature shaves off 93% of the runtime in comparison to just appraising them. Signed-off-by: Yacov Manevich <yacov.manevich@avalabs.org>
Signed-off-by: Yacov Manevich <yacov.manevich@avalabs.org>
Signed-off-by: Yacov Manevich <yacov.manevich@avalabs.org>
Signed-off-by: Yacov Manevich <yacov.manevich@avalabs.org>
Signed-off-by: Yacov Manevich <yacov.manevich@avalabs.org>
Signed-off-by: Yacov Manevich <yacov.manevich@avalabs.org>
StephenButtolph
approved these changes
Aug 2, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why this should be merged
When bootstrapping blocks of the P-chain, the node verifies blocks when it replicates them from remote nodes,
and afterwards it executes them.
When executing them, it verifies the blocks once again via parsing them.
This is redundant, as it has already parsed them before while replicating them.
When testing a chunk of 1000 blocks, parsing the blocks without verifying the signature shaves off 93% of the runtime
in comparison to just appraising them.
How this works
This change introduces a concept called "local parsing", which similar to the parser
found in snow/engine/snowman/block/vm.go, converts the bytes of a block to a snowman.Block.
However, unlike the Parser, it is only implemented at the proposerVM, and doesn't verify the signature
of the block, reducing the CPU cycles it costs to execute the blocks when bootstrapping.
How this was tested
Regular CI tests